
<template>
  <WebTable :list="one.children" noPage>
    <RowText label="名称" bind="spareName" />

    <RowText label="型号" bind="model" />

    <RowText label="单位" bind="unitName" />

    <RowOperate v-if="!isShow" :btns="['del']" :onDel="toDel" />
  </WebTable>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'SpareAddList',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 删除
     */
    toDel(row) {
      const index = this.one.children.findIndex((item) => item.id === row.id)
      this.one.children.splice(index, 1)
    },
  },
}
</script>
